<?php
class TaggableHelper extends AppHelper {
    public $helpers = array('Html', 'Text');
    public function generateCompany($data){
        $content = '<h3 class="link '. $data['model'] .'">';
        $content .=  $this->Html->link($data['name'], array('controller'=>'companies', 'action'=>'view', $data['id']), array(), false, false);
        $content .= '</h3>';
        $content .= '<p class="abstract">';
        $content .= $this->Text->truncate(strip_tags($data['introduction']), 200);
        $content .= '</p>';
        return $content;
    }
    public function generatePost($data){
        $content = '<h3 class="link '.strtolower($data['model']).'">';
        $content .= $this->Html->link($data['title'], array('controller'=>'posts', 'action'=>'view', $data['id']), array(), false, false);
        $content .= '</h3>';
        $content .= '<p class="abstract">';
        $content .= $this->Text->truncate(strip_tags($data['content']), 200);
        $content .= '</p>';
        return $content;
    }
}
?>